home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Checking for a file => Does it exist (Help)
- Date: Sun, 21 Jan 96 14:56:59 GMT
- Organization: none
- Message-ID: <822236219snz@genesis.demon.co.uk>
- References: <4d9k6fINNnja@faatcrl.faa.gov> <4dc6kq$dja@gryphon.phoenix.net> <30FCF419.3B44@rennes.cern.ch> <821900925snz@genesis.demon.co.uk> <4dr4d7$n6k@noc.tor.hookup.net>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4dr4d7$n6k@noc.tor.hookup.net>
- Rajendra_Singh@msn.com "Rajendra Singh" writes:
-
- >Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
- >
- >
- >>The C language does not define a function called 'access'. POSIX does but
- >>it is rather specialised and probably doesn't do what you want.
- >
- >That may be true, but EVERY C compiler that I have used has it: AIX,
- >HPUX, Watcom, Borland.
-
- It doesn't matter how many platforms support it, if it does the wrong thing
- on many of them. Have you read the man page for access on AIX or HPUX,
- *carefully* ? While POSIX isn't part of C it is worth quoting the following
- to indicate why you shouldn't use access in 'portable' code. From the access
- description in "POSIX Programmer's Guide" by Donald Lewine:
-
- ``access uses the real UID, not the effective UID. It is not a general utility
- for finding out "Can I do this?" before doing a call. It is used by SETUID
- programs to check their actions.''
-
- If the standard C functions aren't up to your needs probably the most
- portable solution to this is to use stat().
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-